package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  会员变更-操作类型枚举
 * @author ds
 * @date 2021/5/8
 * @version 2.0.0
 */
public enum MemberChangeOperateTypeEnum {
    /**
     * 待审核会员变更(一级)
     */
    TO_BE_VALIFY_STEP1(1, "待审核会员变更(一级)", "/memberCenter/memberAbility/manage/memberPrVerifyChange1"),
    /**
     * 待审核会员变更(二级)
     */
    TO_BE_VALIFY_STEP2(2, "待审核会员变更(二级)", "/memberCenter/memberAbility/manage/memberPrVerifyChange2"),
    /**
     * 待确认会员变更
     */
    TO_BE_CONFIRM(3, "待确认会员变更", "/memberCenter/memberAbility/manage/memberPrVerifyChangeConfirm");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    MemberChangeOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static MemberChangeOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(MemberChangeOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }

}
